package Controller;


import xml.Message;
import Boundary.CreateEventForm;

/** get the information from the GUI and Create request to send to server
 * 
 * @author zhaolongli
 *
 */

public class CreateEventController {
	
	//GUI to get information from
	CreateEventForm view;
	
	public CreateEventController(CreateEventForm cef){
		view = cef;
	}
	
	public void process(){
		
		view.setVisible(false);
		view.getMain().setVisible(true);
		
	// just for testing purpose
		
		// number of user
		int numN = 3;
		//number of rounds
		int numM = 3;
		//Question
		String question = "testing";
		//status of event
		String type = "open";
		
		// just a test.......
		String xmlString = Message.requestHeader() + "<createRequest type='" + type + "' " +
				"question='" + question + "' " +
				"numChoices='" + numN + "' " + 
				"numRounds = '" + numM + "'> " +
			    "<choice value = 'choice1'   index='1'/>"+
			    "<user   name='Zhaolong Li' />"+
			    "</createRequest>"+
			    "</request>";
		
		Message req = new Message (xmlString);
		ServerAccessManager.getAccess().sendRequest(req);
		
		
		
	}

}
